import React, {Component} from 'react';
import { View, Text,StyleSheet,Image,Dimensions } from 'react-native';
import Header from '../components/Header';
import Footer from '../components/Footer';
import config from '../config';

export default class Layout extends Component {

    componentDidMount() {
    }

    //组件卸载
    componentWillUnmount() {

    }

    componentWillReceiveProps(nextProps) {
    }

    render() {
        return (
            //布局一
            // <View style={{ flex:1}}>
            //     <View style={{flex: 1,backgroundColor:'red'}}>
            //          <Header {...this.props}>{config.sitename}</Header>
            //     </View>
            //     <View style={{height:Dimensions.get("window").height-180}}>
            //         {this.props.children}
            //     </View>
            //     <View style={{flex: 1,backgroundColor:'orange'}}>
            //         <Footer {...this.props}/>
            //     </View>
            // </View>
  
            //布局二
            <View style={{ width:"100%", height:"100%"}}>
            <View style={{height:50,top:0,width:"100%",position:"absolute",backgroundColor:"red"}}>
                <Header {...this.props}>{config.sitename}</Header>
            </View>
            <View style={{bottom:50,top:50,width:"100%",position:"absolute"}}>
                {this.props.children}
            </View>
            <View style={{height:50,bottom:0,width:"100%",position:"absolute"}}>
                <Footer {...this.props}/>
            </View>
            </View>
        );
    }
}
